module.exports = function (app) {
    //配置静态目录
    app.all('*', require('../filter/setStaticHost.js'));
    //自动加载用户信息
    app.all('*', require('../filter/autoLoadUserInfo.js'));

    var userMethod = require('./user/add.js');
    app.all('/sign', userMethod);

    var loginMethod = require('./user/login');
    app.all('/login', loginMethod);

    var imageMethod = require('./media/add.js');
    app.all('/add/media', imageMethod);

    var mediaListMethod = require('./media/list.js');
    app.get('/medias', mediaListMethod);
    app.get('/medias/page/:page', mediaListMethod);
    app.get('/', mediaListMethod);
    app.get('/page/:page', mediaListMethod);

    var mediaMethod = require('./media/media.js');
    app.get('/pin/:id', mediaMethod);

    var getMediaMethod = require('./getMedia.js');
    app.get('/getmedia', getMediaMethod);
};